Reduction of binary quadratic forms